<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - self_test2.info - network_io/unix/inet_ntop.c</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LCOV - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
          <tr>
            <td width="10%" class="headerItem">Current view:</td>
            <td width="35%" class="headerValue"><a href="../../index.html">top level</a> - <a href="index.html">network_io/unix</a> - inet_ntop.c<span style="font-size: 80%;"> (source / <a href="inet_ntop.c.func.html">functions</a>)</span></td>
            <td width="5%"></td>
            <td width="15%"></td>
            <td width="10%" class="headerCovTableHead">Hit</td>
            <td width="10%" class="headerCovTableHead">Total</td>
            <td width="15%" class="headerCovTableHead">Coverage</td>
          </tr>
          <tr>
            <td class="headerItem">Test:</td>
            <td class="headerValue">self_test2.info</td>
            <td></td>
            <td class="headerItem">Lines:</td>
            <td class="headerCovTableEntry">65</td>
            <td class="headerCovTableEntry">76</td>
            <td class="headerCovTableEntryMed">85.5 %</td>
          </tr>
          <tr>
            <td class="headerItem">Date:</td>
            <td class="headerValue">2011-07-03</td>
            <td></td>
            <td class="headerItem">Functions:</td>
            <td class="headerCovTableEntry">3</td>
            <td class="headerCovTableEntry">3</td>
            <td class="headerCovTableEntryHi">100.0 %</td>
          </tr>
          <tr>
            <td></td>
            <td></td>
            <td></td>
            <td class="headerItem">Branches:</td>
            <td class="headerCovTableEntry">37</td>
            <td class="headerCovTableEntry">57</td>
            <td class="headerCovTableEntryLo">64.9 %</td>
          </tr>
          <tr><td><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
        </table>
      </td>
    </tr>

    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td>
<pre class="sourceHeading">           Branch data     Line data    Source code</pre>
<pre class="source">
<a name="1"><span class="lineNum">       1 </span>                :            : /* Copyright (c) 1996 by Internet Software Consortium.</a>
<span class="lineNum">       2 </span>                :            :  *
<span class="lineNum">       3 </span>                :            :  * Permission to use, copy, modify, and distribute this software for any
<span class="lineNum">       4 </span>                :            :  * purpose with or without fee is hereby granted, provided that the above
<span class="lineNum">       5 </span>                :            :  * copyright notice and this permission notice appear in all copies.
<span class="lineNum">       6 </span>                :            :  *
<span class="lineNum">       7 </span>                :            :  * THE SOFTWARE IS PROVIDED &quot;AS IS&quot; AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
<span class="lineNum">       8 </span>                :            :  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
<span class="lineNum">       9 </span>                :            :  * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
<span class="lineNum">      10 </span>                :            :  * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
<span class="lineNum">      11 </span>                :            :  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
<span class="lineNum">      12 </span>                :            :  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
<span class="lineNum">      13 </span>                :            :  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
<span class="lineNum">      14 </span>                :            :  * SOFTWARE.
<span class="lineNum">      15 </span>                :            :  */
<span class="lineNum">      16 </span>                :            : 
<span class="lineNum">      17 </span>                :            : #include &quot;apr_private.h&quot;
<span class="lineNum">      18 </span>                :            : #include &quot;apr_arch_networkio.h&quot;
<span class="lineNum">      19 </span>                :            : #include &quot;apr_strings.h&quot;
<span class="lineNum">      20 </span>                :            : 
<span class="lineNum">      21 </span>                :            : #if APR_HAVE_SYS_TYPES_H
<span class="lineNum">      22 </span>                :            : #include &lt;sys/types.h&gt;
<span class="lineNum">      23 </span>                :            : #endif
<span class="lineNum">      24 </span>                :            : #if APR_HAVE_SYS_SOCKET_H
<span class="lineNum">      25 </span>                :            : #include &lt;sys/socket.h&gt;
<span class="lineNum">      26 </span>                :            : #endif
<span class="lineNum">      27 </span>                :            : #if APR_HAVE_NETINET_IN_H
<span class="lineNum">      28 </span>                :            : #include &lt;netinet/in.h&gt;
<span class="lineNum">      29 </span>                :            : #endif
<span class="lineNum">      30 </span>                :            : #if APR_HAVE_ARPA_INET_H
<span class="lineNum">      31 </span>                :            : #include &lt;arpa/inet.h&gt;
<span class="lineNum">      32 </span>                :            : #endif
<span class="lineNum">      33 </span>                :            : #include &lt;string.h&gt;
<span class="lineNum">      34 </span>                :            : #if APR_HAVE_ERRNO_H
<span class="lineNum">      35 </span>                :            : #include &lt;errno.h&gt;
<span class="lineNum">      36 </span>                :            : #endif
<span class="lineNum">      37 </span>                :            : #include &lt;stdio.h&gt;
<span class="lineNum">      38 </span>                :            : 
<span class="lineNum">      39 </span>                :            : #ifndef IN6ADDRSZ
<span class="lineNum">      40 </span>                :            : #define IN6ADDRSZ   16
<span class="lineNum">      41 </span>                :            : #endif
<span class="lineNum">      42 </span>                :            : 
<span class="lineNum">      43 </span>                :            : #ifndef INT16SZ
<span class="lineNum">      44 </span>                :            : #define INT16SZ sizeof(apr_int16_t)
<span class="lineNum">      45 </span>                :            : #endif
<span class="lineNum">      46 </span>                :            : 
<span class="lineNum">      47 </span>                :            : #ifndef __P
<span class="lineNum">      48 </span>                :            : #define __P(x) x
<span class="lineNum">      49 </span>                :            : #endif
<span class="lineNum">      50 </span>                :            : 
<span class="lineNum">      51 </span>                :            : #if !defined(EAFNOSUPPORT) &amp;&amp; defined(WSAEAFNOSUPPORT)
<span class="lineNum">      52 </span>                :            : #define EAFNOSUPPORT WSAEAFNOSUPPORT
<span class="lineNum">      53 </span>                :            : #endif
<span class="lineNum">      54 </span>                :            : 
<span class="lineNum">      55 </span>                :            : /*
<span class="lineNum">      56 </span>                :            :  * WARNING: Don't even consider trying to compile this on a system where
<span class="lineNum">      57 </span>                :            :  * sizeof(int) &lt; 4.  sizeof(int) &gt; 4 is fine; all the world's not a VAX.
<span class="lineNum">      58 </span>                :            :  */
<span class="lineNum">      59 </span>                :            : 
<span class="lineNum">      60 </span>                :            : static const char *inet_ntop4 __P((const unsigned char *src, char *dst, apr_size_t size));
<span class="lineNum">      61 </span>                :            : #if APR_HAVE_IPV6
<span class="lineNum">      62 </span>                :            : static const char *inet_ntop6 __P((const unsigned char *src, char *dst, apr_size_t size));
<span class="lineNum">      63 </span>                :            : #endif
<span class="lineNum">      64 </span>                :            : 
<span class="lineNum">      65 </span>                :            : /* char *
<span class="lineNum">      66 </span>                :            :  * inet_ntop(af, src, dst, size)
<span class="lineNum">      67 </span>                :            :  *      convert a network format address to presentation format.
<span class="lineNum">      68 </span>                :            :  * return:
<span class="lineNum">      69 </span>                :            :  *      pointer to presentation format address (`dst'), or NULL (see errno).
<span class="lineNum">      70 </span>                :            :  * author:
<span class="lineNum">      71 </span>                :            :  *      Paul Vixie, 1996.
<span class="lineNum">      72 </span>                :            :  */
<a name="73"><span class="lineNum">      73 </span>                :            : const char *</a>
<span class="lineNum">      74 </span>                :            : apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size)
<span class="lineNum">      75 </span>                :<span class="lineCov">          6 : {</span>
<span class="lineNum">      76 </span>     [<span class="branchCov" title="Branch 0 was taken 4 times"> + </span><span class="branchCov" title="Branch 1 was taken 2 times"> + </span><span class="branchNoCov" title="Branch 2 was not taken"> - </span>]:<span class="lineCov">          6 :         switch (af) {</span>
<span class="lineNum">      77 </span>                :            :         case AF_INET:
<span class="lineNum">      78 </span>                :<span class="lineCov">          4 :                 return (inet_ntop4(src, dst, size));</span>
<span class="lineNum">      79 </span>                :            : #if APR_HAVE_IPV6
<span class="lineNum">      80 </span>                :            :         case AF_INET6:
<span class="lineNum">      81 </span>                :<span class="lineCov">          2 :                 return (inet_ntop6(src, dst, size));</span>
<span class="lineNum">      82 </span>                :            : #endif
<span class="lineNum">      83 </span>                :            :         default:
<span class="lineNum">      84 </span>                :<span class="lineNoCov">          0 :                 errno = EAFNOSUPPORT;</span>
<span class="lineNum">      85 </span>                :<span class="lineCov">          6 :                 return (NULL);</span>
<span class="lineNum">      86 </span>                :            :         }
<span class="lineNum">      87 </span>                :            :         /* NOTREACHED */
<span class="lineNum">      88 </span>                :            : }
<span class="lineNum">      89 </span>                :            : 
<span class="lineNum">      90 </span>                :            : /* const char *
<span class="lineNum">      91 </span>                :            :  * inet_ntop4(src, dst, size)
<span class="lineNum">      92 </span>                :            :  *      format an IPv4 address, more or less like inet_ntoa()
<span class="lineNum">      93 </span>                :            :  * return:
<span class="lineNum">      94 </span>                :            :  *      `dst' (as a const)
<span class="lineNum">      95 </span>                :            :  * notes:
<span class="lineNum">      96 </span>                :            :  *      (1) uses no statics
<span class="lineNum">      97 </span>                :            :  *      (2) takes a u_char* not an in_addr as input
<span class="lineNum">      98 </span>                :            :  * author:
<span class="lineNum">      99 </span>                :            :  *      Paul Vixie, 1996.
<span class="lineNum">     100 </span>                :            :  */
<a name="101"><span class="lineNum">     101 </span>                :            : static const char *</a>
<span class="lineNum">     102 </span>                :            : inet_ntop4(const unsigned char *src, char *dst, apr_size_t size)
<span class="lineNum">     103 </span>                :<span class="lineCov">          5 : {</span>
<span class="lineNum">     104 </span>                :<span class="lineCov">          5 :         const apr_size_t MIN_SIZE = 16; /* space for 255.255.255.255\0 */</span>
<span class="lineNum">     105 </span>                :<span class="lineCov">          5 :         int n = 0;</span>
<span class="lineNum">     106 </span>                :<span class="lineCov">          5 :         char *next = dst;</span>
<span class="lineNum">     107 </span>                :            : 
<span class="lineNum">     108 </span>        [<span class="branchNoCov" title="Branch 0 was not taken"> - </span><span class="branchCov" title="Branch 1 was taken 5 times"> + </span>]:<span class="lineCov">          5 :         if (size &lt; MIN_SIZE) {</span>
<span class="lineNum">     109 </span>                :<span class="lineNoCov">          0 :             errno = ENOSPC;</span>
<span class="lineNum">     110 </span>                :<span class="lineNoCov">          0 :             return NULL;</span>
<span class="lineNum">     111 </span>                :            :         }
<span class="lineNum">     112 </span>                :            :         do {
<span class="lineNum">     113 </span>                :<span class="lineCov">         20 :             unsigned char u = *src++;</span>
<span class="lineNum">     114 </span>        [<span class="branchCov" title="Branch 0 was taken 3 times"> + </span><span class="branchCov" title="Branch 1 was taken 17 times"> + </span>]:<span class="lineCov">         20 :             if (u &gt; 99) {</span>
<span class="lineNum">     115 </span>                :<span class="lineCov">          3 :                 *next++ = '0' + u/100;</span>
<span class="lineNum">     116 </span>                :<span class="lineCov">          3 :                 u %= 100;</span>
<span class="lineNum">     117 </span>                :<span class="lineCov">          3 :                 *next++ = '0' + u/10;</span>
<span class="lineNum">     118 </span>                :<span class="lineCov">          3 :                 u %= 10;</span>
<span class="lineNum">     119 </span>                :            :             }
<span class="lineNum">     120 </span>        [<span class="branchNoCov" title="Branch 0 was not taken"> - </span><span class="branchCov" title="Branch 1 was taken 17 times"> + </span>]:<span class="lineCov">         17 :             else if (u &gt; 9) {</span>
<span class="lineNum">     121 </span>                :<span class="lineNoCov">          0 :                 *next++ = '0' + u/10;</span>
<span class="lineNum">     122 </span>                :<span class="lineNoCov">          0 :                 u %= 10;</span>
<span class="lineNum">     123 </span>                :            :             }
<span class="lineNum">     124 </span>                :<span class="lineCov">         20 :             *next++ = '0' + u;</span>
<span class="lineNum">     125 </span>                :<span class="lineCov">         20 :             *next++ = '.';</span>
<span class="lineNum">     126 </span>                :<span class="lineCov">         20 :             n++;</span>
<span class="lineNum">     127 </span>        [<span class="branchCov" title="Branch 0 was taken 15 times"> + </span><span class="branchCov" title="Branch 1 was taken 5 times"> + </span>]:<span class="lineCov">         20 :         } while (n &lt; 4);</span>
<span class="lineNum">     128 </span>                :<span class="lineCov">          5 :         *--next = 0;</span>
<span class="lineNum">     129 </span>                :<span class="lineCov">          5 :         return dst;</span>
<span class="lineNum">     130 </span>                :            : }
<span class="lineNum">     131 </span>                :            : 
<span class="lineNum">     132 </span>                :            : #if APR_HAVE_IPV6
<span class="lineNum">     133 </span>                :            : /* const char *
<span class="lineNum">     134 </span>                :            :  * inet_ntop6(src, dst, size)
<span class="lineNum">     135 </span>                :            :  *      convert IPv6 binary address into presentation (printable) format
<span class="lineNum">     136 </span>                :            :  * author:
<span class="lineNum">     137 </span>                :            :  *      Paul Vixie, 1996.
<span class="lineNum">     138 </span>                :            :  */
<a name="139"><span class="lineNum">     139 </span>                :            : static const char *</a>
<span class="lineNum">     140 </span>                :            : inet_ntop6(const unsigned char *src, char *dst, apr_size_t size)
<span class="lineNum">     141 </span>                :<span class="lineCov">          2 : {</span>
<span class="lineNum">     142 </span>                :            :     /*
<span class="lineNum">     143 </span>                :            :      * Note that int32_t and int16_t need only be &quot;at least&quot; large enough
<span class="lineNum">     144 </span>                :            :      * to contain a value of the specified size.  On some systems, like
<span class="lineNum">     145 </span>                :            :      * Crays, there is no such thing as an integer variable with 16 bits.
<span class="lineNum">     146 </span>                :            :      * Keep this in mind if you think this function should have been coded
<span class="lineNum">     147 </span>                :            :      * to use pointer overlays.  All the world's not a VAX.
<span class="lineNum">     148 </span>                :            :      */
<span class="lineNum">     149 </span>                :            :     char tmp[sizeof &quot;ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255&quot;], *tp;
<span class="lineNum">     150 </span>                :<span class="lineCov">          2 :     struct { int base, len; } best = {-1, 0}, cur = {-1, 0};</span>
<span class="lineNum">     151 </span>                :            :     unsigned int words[IN6ADDRSZ / INT16SZ];
<span class="lineNum">     152 </span>                :            :     int i;
<span class="lineNum">     153 </span>                :            :     const unsigned char *next_src, *src_end;
<span class="lineNum">     154 </span>                :            :     unsigned int *next_dest;
<span class="lineNum">     155 </span>                :            : 
<span class="lineNum">     156 </span>                :            :     /*
<span class="lineNum">     157 </span>                :            :      * Preprocess:
<span class="lineNum">     158 </span>                :            :      *  Copy the input (bytewise) array into a wordwise array.
<span class="lineNum">     159 </span>                :            :      *  Find the longest run of 0x00's in src[] for :: shorthanding.
<span class="lineNum">     160 </span>                :            :      */
<span class="lineNum">     161 </span>                :<span class="lineCov">          2 :     next_src = src;</span>
<span class="lineNum">     162 </span>                :<span class="lineCov">          2 :     src_end = src + IN6ADDRSZ;</span>
<span class="lineNum">     163 </span>                :<span class="lineCov">          2 :     next_dest = words;</span>
<span class="lineNum">     164 </span>                :<span class="lineCov">          2 :     i = 0;</span>
<span class="lineNum">     165 </span>                :            :     do {
<span class="lineNum">     166 </span>                :<span class="lineCov">         16 :         unsigned int next_word = (unsigned int)*next_src++;</span>
<span class="lineNum">     167 </span>                :<span class="lineCov">         16 :         next_word &lt;&lt;= 8;</span>
<span class="lineNum">     168 </span>                :<span class="lineCov">         16 :         next_word |= (unsigned int)*next_src++;</span>
<span class="lineNum">     169 </span>                :<span class="lineCov">         16 :         *next_dest++ = next_word;</span>
<span class="lineNum">     170 </span>                :            : 
<span class="lineNum">     171 </span>        [<span class="branchCov" title="Branch 0 was taken 14 times"> + </span><span class="branchCov" title="Branch 1 was taken 2 times"> + </span>]:<span class="lineCov">         16 :         if (next_word == 0) {</span>
<span class="lineNum">     172 </span>        [<span class="branchCov" title="Branch 0 was taken 3 times"> + </span><span class="branchCov" title="Branch 1 was taken 11 times"> + </span>]:<span class="lineCov">         14 :             if (cur.base == -1) {</span>
<span class="lineNum">     173 </span>                :<span class="lineCov">          3 :                 cur.base = i;</span>
<span class="lineNum">     174 </span>                :<span class="lineCov">          3 :                 cur.len = 1;</span>
<span class="lineNum">     175 </span>                :            :             }
<span class="lineNum">     176 </span>                :            :             else {
<span class="lineNum">     177 </span>                :<span class="lineCov">         11 :                 cur.len++;</span>
<span class="lineNum">     178 </span>                :            :             }
<span class="lineNum">     179 </span>                :            :         } else {
<span class="lineNum">     180 </span>        [<span class="branchCov" title="Branch 0 was taken 2 times"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov">          2 :             if (cur.base != -1) {</span>
<span class="lineNum">     181 </span>[<span class="branchNoCov" title="Branch 0 was not taken"> - </span><span class="branchCov" title="Branch 1 was taken 2 times"> + </span>][<span class="branchNoExec" title="Branch 2 was not executed"> # </span><span class="branchNoExec" title="Branch 3 was not executed"> # </span>]:<span class="lineCov">          2 :                 if (best.base == -1 || cur.len &gt; best.len) {</span>
<span class="lineNum">     182 </span>                :<span class="lineCov">          2 :                     best = cur;</span>
<span class="lineNum">     183 </span>                :            :                 }
<span class="lineNum">     184 </span>                :<span class="lineCov">          2 :                 cur.base = -1;</span>
<span class="lineNum">     185 </span>                :            :             }
<span class="lineNum">     186 </span>                :            :         }
<span class="lineNum">     187 </span>                :            : 
<span class="lineNum">     188 </span>                :<span class="lineCov">         16 :         i++;</span>
<span class="lineNum">     189 </span>        [<span class="branchCov" title="Branch 0 was taken 14 times"> + </span><span class="branchCov" title="Branch 1 was taken 2 times"> + </span>]:<span class="lineCov">         16 :     } while (next_src &lt; src_end);</span>
<span class="lineNum">     190 </span>                :            : 
<span class="lineNum">     191 </span>        [<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchCov" title="Branch 1 was taken 1 time"> + </span>]:<span class="lineCov">          2 :     if (cur.base != -1) {</span>
<span class="lineNum">     192 </span>[<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>][<span class="branchNoCov" title="Branch 2 was not taken"> - </span><span class="branchCov" title="Branch 3 was taken 1 time"> + </span>]:<span class="lineCov">          1 :         if (best.base == -1 || cur.len &gt; best.len) {</span>
<span class="lineNum">     193 </span>                :<span class="lineNoCov">          0 :             best = cur;</span>
<span class="lineNum">     194 </span>                :            :         }
<span class="lineNum">     195 </span>                :            :     }
<span class="lineNum">     196 </span>[<span class="branchCov" title="Branch 0 was taken 2 times"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>][<span class="branchNoCov" title="Branch 2 was not taken"> - </span><span class="branchCov" title="Branch 3 was taken 2 times"> + </span>]:<span class="lineCov">          2 :     if (best.base != -1 &amp;&amp; best.len &lt; 2) {</span>
<span class="lineNum">     197 </span>                :<span class="lineNoCov">          0 :         best.base = -1;</span>
<span class="lineNum">     198 </span>                :            :     }
<span class="lineNum">     199 </span>                :            : 
<span class="lineNum">     200 </span>                :            :     /*
<span class="lineNum">     201 </span>                :            :      * Format the result.
<span class="lineNum">     202 </span>                :            :      */
<span class="lineNum">     203 </span>                :<span class="lineCov">          2 :     tp = tmp;</span>
<span class="lineNum">     204 </span>        [<span class="branchCov" title="Branch 0 was taken 5 times"> + </span><span class="branchCov" title="Branch 1 was taken 1 time"> + </span>]:<span class="lineCov">          6 :     for (i = 0; i &lt; (IN6ADDRSZ / INT16SZ);) {</span>
<span class="lineNum">     205 </span>                :            :         /* Are we inside the best run of 0x00's? */
<span class="lineNum">     206 </span>        [<span class="branchCov" title="Branch 0 was taken 2 times"> + </span><span class="branchCov" title="Branch 1 was taken 3 times"> + </span>]:<span class="lineCov">          5 :         if (i == best.base) {</span>
<span class="lineNum">     207 </span>                :<span class="lineCov">          2 :             *tp++ = ':';</span>
<span class="lineNum">     208 </span>                :<span class="lineCov">          2 :             i += best.len;</span>
<span class="lineNum">     209 </span>                :<span class="lineCov">          2 :             continue;</span>
<span class="lineNum">     210 </span>                :            :         }
<span class="lineNum">     211 </span>                :            :         /* Are we following an initial run of 0x00s or any real hex? */
<span class="lineNum">     212 </span>        [<span class="branchCov" title="Branch 0 was taken 3 times"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>]:<span class="lineCov">          3 :         if (i != 0) {</span>
<span class="lineNum">     213 </span>                :<span class="lineCov">          3 :             *tp++ = ':';</span>
<span class="lineNum">     214 </span>                :            :         }
<span class="lineNum">     215 </span>                :            :         /* Is this address an encapsulated IPv4? */
<span class="lineNum">     216 </span>[<span class="branchCov" title="Branch 0 was taken 1 time"> + </span><span class="branchCov" title="Branch 1 was taken 2 times"> + </span>][<span class="branchCov" title="Branch 2 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 3 was not taken"> - </span>]:<span class="lineCov">          3 :         if (i == 6 &amp;&amp; best.base == 0 &amp;&amp;</span>
<span class="lineNum">         </span>[<span class="branchCov" title="Branch 4 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 5 was not taken"> - </span>][<span class="branchCov" title="Branch 6 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 7 was not taken"> - </span>]
<span class="lineNum">         </span>        [<span class="branchCov" title="Branch 8 was taken 1 time"> + </span><span class="branchNoCov" title="Branch 9 was not taken"> - </span>]
<span class="lineNum">     217 </span>                :            :             (best.len == 6 || (best.len == 5 &amp;&amp; words[5] == 0xffff))) {
<span class="lineNum">     218 </span>        [<span class="branchNoCov" title="Branch 1 was not taken"> - </span><span class="branchCov" title="Branch 2 was taken 1 time"> + </span>]:<span class="lineCov">          1 :             if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp))) {</span>
<span class="lineNum">     219 </span>                :<span class="lineNoCov">          0 :                 return (NULL);</span>
<span class="lineNum">     220 </span>                :            :             }
<span class="lineNum">     221 </span>                :<span class="lineCov">          1 :             tp += strlen(tp);</span>
<span class="lineNum">     222 </span>                :<span class="lineCov">          1 :             break;</span>
<span class="lineNum">     223 </span>                :            :         }
<span class="lineNum">     224 </span>                :<span class="lineCov">          2 :         tp += apr_snprintf(tp, sizeof tmp - (tp - tmp), &quot;%x&quot;, words[i]);</span>
<span class="lineNum">     225 </span>                :<span class="lineCov">          2 :         i++;</span>
<span class="lineNum">     226 </span>                :            :     }
<span class="lineNum">     227 </span>                :            :     /* Was it a trailing run of 0x00's? */
<span class="lineNum">     228 </span>[<span class="branchCov" title="Branch 0 was taken 2 times"> + </span><span class="branchNoCov" title="Branch 1 was not taken"> - </span>][<span class="branchNoCov" title="Branch 2 was not taken"> - </span><span class="branchCov" title="Branch 3 was taken 2 times"> + </span>]:<span class="lineCov">          2 :     if (best.base != -1 &amp;&amp; (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) {</span>
<span class="lineNum">     229 </span>                :<span class="lineNoCov">          0 :         *tp++ = ':';</span>
<span class="lineNum">     230 </span>                :            :     }
<span class="lineNum">     231 </span>                :<span class="lineCov">          2 :     *tp++ = '\0';</span>
<span class="lineNum">     232 </span>                :            : 
<span class="lineNum">     233 </span>                :            :     /*
<span class="lineNum">     234 </span>                :            :      * Check for overflow, copy, and we're done.
<span class="lineNum">     235 </span>                :            :      */
<span class="lineNum">     236 </span>        [<span class="branchNoCov" title="Branch 0 was not taken"> - </span><span class="branchCov" title="Branch 1 was taken 2 times"> + </span>]:<span class="lineCov">          2 :     if ((apr_size_t)(tp - tmp) &gt; size) {</span>
<span class="lineNum">     237 </span>                :<span class="lineNoCov">          0 :         errno = ENOSPC;</span>
<span class="lineNum">     238 </span>                :<span class="lineNoCov">          0 :         return (NULL);</span>
<span class="lineNum">     239 </span>                :            :     }
<span class="lineNum">     240 </span>                :            :     strcpy(dst, tmp);
<span class="lineNum">     241 </span>                :<span class="lineCov">          2 :     return (dst);</span>
<span class="lineNum">     242 </span>                :            : }
<span class="lineNum">     243 </span>                :            : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
    <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LCOV version 1.9</a></td></tr>
  </table>
  <br>

</body>
</html>
